home *** CD-ROM | disk | FTP | other *** search
- // copy4.cpp: Copy one file to another
- #include <iostream.h>
- #include <fstream.h> // Required for file streams
- #include <stdlib.h>
-
- main(int argc, char *argv[])
- {
- if (argc == 3)
- {
- ifstream inf(argv[1]);
- ofstream outf(argv[2]);
- if (inf && outf)
- {
- char c;
-
- while (inf.get(c))
- outf.put(c);
-
- return EXIT_SUCCESS;
- } // Streams destroyed by this point
- }
- return EXIT_FAILURE;
- }
-
-